//
//  NSMutableDictionary+setObject.m
//  DWCoach
//
//  Created by Mxionlly on 17/2/15.
//  Copyright © 2017年 Ostrish. All rights reserved.
//

#import "NSMutableDictionary+setObject.h"

@implementation NSMutableDictionary (setObject)
- (void)setField:(id<NSCopying>)strField value:(id)strValue
{
    [self safe_setObject:strField forKey:strValue];
}

- (void)safe_setObject:(id)anObject forKey:(id<NSCopying>)aKey {
    if ( aKey ) {
        if ( anObject==nil ) {
            [self removeObjectForKey:aKey];
        }
        else {
            [self setObject:anObject forKey:aKey];
        }
    }
}
@end
